package com.example.newbee.api;

import com.example.newbee.bean.TagBean;
import com.example.newbee.bean.TravelBean;
import com.example.newbee.bean.UserBean;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

public interface APi {
    @POST("hornetUser/login")
    @FormUrlEncoded
    Observable<UserBean> login(@Field("username")String username, @Field("user_password")String pwd);

    //注册
    @POST("hornetUser/register")
    Observable<UserBean> register(@Body RequestBody body);


    //获取标签
    @POST("tag/seltag")
    Observable<List<TagBean>> tags();

    //获取游记
    @FormUrlEncoded
    @POST("travels/seltagtravels")
    Observable<List<TravelBean>> travelsForTag(@Field("tag") int tagId, @Field("page") int page);



}
